import { Swiper  } from "antd-mobile"
import axios from "axios"
import { useEffect,useState } from "react"
import { useNavigate } from "react-router-dom"
const Home=()=>{
    const getLIst=async()=>{
        const res=await axios.get('/api/swiper')
        console.log(res);
        setList(res.data.data)
    }
    const [list,setList]=useState([])
    const nav= useNavigate()
    useEffect(()=>{
        getLIst()
    },[])
    return <div>
        <Swiper autoplay>
            {
                list.map((v,i)=>{
                    return <Swiper.Item key={{i}}>
                        <img width={'100%'} src={v.image} alt="" />
                    </Swiper.Item>
                })
                
            }
        </Swiper>
        
    </div>
    
}
export default Home 